//配置express中间件，讲app传入路由控制
const express=require('express');
const session = require("express-session");
const bodyParser = require("body-parser");
const multiparty = require('connect-multiparty');
const base=require('../config/base');
var multipartyMiddleware = multiparty({uploadDir:base.tempFile});

var app=express();
app.use(multipartyMiddleware);
app.use(express.static("./public"));//静态资源文件
app.use(session({secret:"abc"}));
app.use(bodyParser.json());//请求头要加 Content-Type:application/json
app.use(bodyParser.urlencoded());

require('../routes/dish.server.route')(app);
require('../routes/merchant.server.route')(app);
require('../routes/order.server.route')(app);


module.exports=app;